package com.jed.xxh.adapter;

import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.jed.xxh.R;
import com.jed.xxh.entity.CourierData;

import java.util.List;

/**
 * 项目名：SmartButler<br/>
 * 包名：  com.jed.xxh.adapter<br/>
 * 作者：徐晓辉<br/>
 * 创建日期：2018/11/27 13:06<br/>
 * 描述：物流查询<br/>
 */
public class CourierAdapter extends MyBaseAdapter {

    private List<CourierData> mList;

    public CourierAdapter(List<CourierData> mList) {
        super(mList);
        this.mList = mList;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {

        Holder holder;
        if (convertView == null) {
            holder = new Holder();
            convertView = inflater.inflate(R.layout.layout_courier_item, null);
            holder.tv_remark = convertView.findViewById(R.id.tv_remark);
            holder.tv_zone = convertView.findViewById(R.id.tv_zone);
            holder.tv_dataTime = convertView.findViewById(R.id.tv_dataTime);
            convertView.setTag(holder);
        } else {
            holder = (Holder) convertView.getTag();
        }
        CourierData mCourierData = mList.get(position);
        holder.tv_remark.setText(mCourierData.getRemark());
        holder.tv_zone.setText(mCourierData.getZone());
        holder.tv_dataTime.setText(mCourierData.getDataTime());
        return convertView;
    }

    private class Holder {
        private TextView tv_remark;
        private TextView tv_zone;
        private TextView tv_dataTime;

    }

}
